<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人中心</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }
        .ios-shadow {
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        }
        .profile-item {
            transition: all 0.3s ease;
        }
        .profile-item:hover {
            transform: translateY(-2px);
        }
        .achievement-badge {
            background: linear-gradient(45deg, #ffd700, #ffed4e);
            animation: shine 2s infinite;
        }
        @keyframes shine {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.8; }
        }
    </style>
</head>
<body class="min-h-screen">
    <!-- 顶部状态栏 -->
    <div class="bg-white/10 backdrop-blur-md text-white px-4 py-2 flex justify-between items-center">
        <div class="flex items-center space-x-2" onclick="location.href='index.html'">
            <i class="fas fa-arrow-left"></i>
            <span class="text-sm">返回</span>
        </div>
        <div class="text-sm font-medium">个人中心</div>
        <div class="flex items-center space-x-1">
            <i class="fas fa-edit text-sm" onclick="editProfile()"></i>
        </div>
    </div>

    <!-- 个人信息卡片 -->
    <div class="px-4 py-4">
        <div class="bg-white/95 backdrop-blur-md rounded-xl p-6 ios-shadow mb-4">
            <div class="flex items-center space-x-4 mb-4">
                <div class="relative">
                    <div class="w-20 h-20 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center">
                        <img src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=150&h=150&fit=crop&crop=face" 
                             alt="头像" class="w-18 h-18 rounded-full object-cover">
                    </div>
                    <div class="absolute -bottom-1 -right-1 w-6 h-6 bg-green-500 rounded-full border-2 border-white flex items-center justify-center">
                        <i class="fas fa-check text-white text-xs"></i>
                    </div>
                </div>
                <div class="flex-1">
                    <h2 class="text-xl font-bold text-gray-800">我的昵称</h2>
                    <p class="text-gray-600">五子棋爱好者</p>
                    <div class="flex items-center space-x-2 mt-1">
                        <div class="flex items-center space-x-1">
                            <i class="fas fa-star text-yellow-500 text-sm"></i>
                            <span class="text-sm text-gray-600">等级 15</span>
                        </div>
                        <div class="w-1 h-1 bg-gray-400 rounded-full"></div>
                        <span class="text-sm text-gray-600">积分 1,245</span>
                    </div>
                </div>
            </div>
            
            <!-- 经验条 -->
            <div class="mb-4">
                <div class="flex justify-between text-sm text-gray-600 mb-1">
                    <span>经验值</span>
                    <span>1,245 / 1,500</span>
                </div>
                <div class="w-full bg-gray-200 rounded-full h-2">
                    <div class="bg-gradient-to-r from-blue-500 to-purple-600 h-2 rounded-full" style="width: 83%"></div>
                </div>
            </div>
            
            <!-- 快速统计 -->
            <div class="grid grid-cols-4 gap-4 text-center">
                <div>
                    <div class="text-2xl font-bold text-blue-600">28</div>
                    <div class="text-xs text-gray-600">总局数</div>
                </div>
                <div>
                    <div class="text-2xl font-bold text-green-600">19</div>
                    <div class="text-xs text-gray-600">胜利</div>
                </div>
                <div>
                    <div class="text-2xl font-bold text-red-600">9</div>
                    <div class="text-xs text-gray-600">失败</div>
                </div>
                <div>
                    <div class="text-2xl font-bold text-purple-600">68%</div>
                    <div class="text-xs text-gray-600">胜率</div>
                </div>
            </div>
        </div>
    </div>

    <!-- 成就徽章 -->
    <div class="px-4 mb-4">
        <div class="bg-white/95 backdrop-blur-md rounded-xl p-4 ios-shadow">
            <h3 class="text-lg font-semibold text-gray-800 mb-3">最新成就</h3>
            <div class="grid grid-cols-4 gap-3">
                <div class="text-center">
                    <div class="w-12 h-12 achievement-badge rounded-full flex items-center justify-center mx-auto mb-2">
                        <i class="fas fa-trophy text-white"></i>
                    </div>
                    <div class="text-xs text-gray-600">连胜达人</div>
                </div>
                <div class="text-center">
                    <div class="w-12 h-12 bg-gradient-to-br from-blue-500 to-blue-600 rounded-full flex items-center justify-center mx-auto mb-2">
                        <i class="fas fa-fire text-white"></i>
                    </div>
                    <div class="text-xs text-gray-600">火力全开</div>
                </div>
                <div class="text-center">
                    <div class="w-12 h-12 bg-gradient-to-br from-green-500 to-green-600 rounded-full flex items-center justify-center mx-auto mb-2">
                        <i class="fas fa-clock text-white"></i>
                    </div>
                    <div class="text-xs text-gray-600">速战速决</div>
                </div>
                <div class="text-center">
                    <div class="w-12 h-12 bg-gradient-to-br from-purple-500 to-purple-600 rounded-full flex items-center justify-center mx-auto mb-2">
                        <i class="fas fa-brain text-white"></i>
                    </div>
                    <div class="text-xs text-gray-600">智慧之星</div>
                </div>
            </div>
            <div class="text-center mt-3">
                <button class="text-blue-600 text-sm font-medium" onclick="showAllAchievements()">
                    查看全部成就 <i class="fas fa-chevron-right text-xs"></i>
                </button>
            </div>
        </div>
    </div>

    <!-- 功能菜单 -->
    <div class="px-4 pb-20">
        <div class="bg-white/95 backdrop-blur-md rounded-xl ios-shadow">
            <div class="divide-y divide-gray-200">
                <div class="profile-item p-4 flex items-center justify-between" onclick="location.href='history.html'">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-blue-100 rounded-lg flex items-center justify-center">
                            <i class="fas fa-history text-blue-600"></i>
                        </div>
                        <div>
                            <div class="font-medium text-gray-800">游戏记录</div>
                            <div class="text-sm text-gray-600">查看历史对局</div>
                        </div>
                    </div>
                    <i class="fas fa-chevron-right text-gray-400"></i>
                </div>

                <div class="profile-item p-4 flex items-center justify-between" onclick="showStatistics()">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-green-100 rounded-lg flex items-center justify-center">
                            <i class="fas fa-chart-bar text-green-600"></i>
                        </div>
                        <div>
                            <div class="font-medium text-gray-800">详细统计</div>
                            <div class="text-sm text-gray-600">查看详细数据分析</div>
                        </div>
                    </div>
                    <i class="fas fa-chevron-right text-gray-400"></i>
                </div>

                <div class="profile-item p-4 flex items-center justify-between" onclick="showFriends()">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-purple-100 rounded-lg flex items-center justify-center">
                            <i class="fas fa-users text-purple-600"></i>
                        </div>
                        <div>
                            <div class="font-medium text-gray-800">好友列表</div>
                            <div class="text-sm text-gray-600">管理游戏好友</div>
                        </div>
                    </div>
                    <div class="flex items-center space-x-2">
                        <span class="bg-red-500 text-white text-xs px-2 py-1 rounded-full">3</span>
                        <i class="fas fa-chevron-right text-gray-400"></i>
                    </div>
                </div>

                <div class="profile-item p-4 flex items-center justify-between" onclick="showCollection()">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-yellow-100 rounded-lg flex items-center justify-center">
                            <i class="fas fa-bookmark text-yellow-600"></i>
                        </div>
                        <div>
                            <div class="font-medium text-gray-800">收藏夹</div>
                            <div class="text-sm text-gray-600">收藏的精彩对局</div>
                        </div>
                    </div>
                    <i class="fas fa-chevron-right text-gray-400"></i>
                </div>

                <div class="profile-item p-4 flex items-center justify-between" onclick="location.href='settings.html'">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-gray-100 rounded-lg flex items-center justify-center">
                            <i class="fas fa-cog text-gray-600"></i>
                        </div>
                        <div>
                            <div class="font-medium text-gray-800">设置</div>
                            <div class="text-sm text-gray-600">个性化设置</div>
                        </div>
                    </div>
                    <i class="fas fa-chevron-right text-gray-400"></i>
                </div>

                <div class="profile-item p-4 flex items-center justify-between" onclick="shareProfile()">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-pink-100 rounded-lg flex items-center justify-center">
                            <i class="fas fa-share text-pink-600"></i>
                        </div>
                        <div>
                            <div class="font-medium text-gray-800">分享</div>
                            <div class="text-sm text-gray-600">分享我的战绩</div>
                        </div>
                    </div>
                    <i class="fas fa-chevron-right text-gray-400"></i>
                </div>
            </div>
        </div>
    </div>

    <!-- 编辑资料弹窗 -->
    <div id="editModal" class="fixed inset-0 bg-black/50 backdrop-blur-sm hidden flex items-center justify-center z-50">
        <div class="bg-white rounded-2xl p-6 mx-4 w-full max-w-sm ios-shadow">
            <h3 class="text-lg font-semibold text-gray-800 mb-4 text-center">编辑资料</h3>
            
            <div class="space-y-4">
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">昵称</label>
                    <input type="text" value="我的昵称" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
                </div>
                
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">个人简介</label>
                    <textarea class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 h-20" placeholder="介绍一下自己...">五子棋爱好者</textarea>
                </div>
            </div>
            
            <div class="flex space-x-3 mt-6">
                <button onclick="closeEditModal()" class="flex-1 bg-gray-200 text-gray-800 py-3 rounded-xl font-medium">
                    取消
                </button>
                <button onclick="saveProfile()" class="flex-1 bg-gradient-to-r from-blue-500 to-blue-600 text-white py-3 rounded-xl font-medium">
                    保存
                </button>
            </div>
        </div>
    </div>

    <!-- 底部导航栏 -->
    <div class="fixed bottom-0 left-0 right-0 bg-white/95 backdrop-blur-md border-t border-gray-200/50">
        <div class="flex justify-around py-3">
            <div class="flex flex-col items-center text-gray-400" onclick="location.href='index.html'">
                <i class="fas fa-home text-xl mb-1"></i>
                <span class="text-xs">首页</span>
            </div>
            <div class="flex flex-col items-center text-gray-400" onclick="location.href='game.html'">
                <i class="fas fa-gamepad text-xl mb-1"></i>
                <span class="text-xs">游戏</span>
            </div>
            <div class="flex flex-col items-center text-blue-600">
                <i class="fas fa-user text-xl mb-1"></i>
                <span class="text-xs">我的</span>
            </div>
        </div>
    </div>

    <script>
        // 编辑资料
        function editProfile() {
            document.getElementById('editModal').classList.remove('hidden');
        }

        // 关闭编辑弹窗
        function closeEditModal() {
            document.getElementById('editModal').classList.add('hidden');
        }

        // 保存资料
        function saveProfile() {
            // 这里可以添加保存逻辑
            alert('资料已保存');
            closeEditModal();
        }

        // 显示所有成就
        function showAllAchievements() {
            alert('查看全部成就功能');
        }

        // 显示统计信息
        function showStatistics() {
            alert('详细统计功能');
        }

        // 显示好友列表
        function showFriends() {
            alert('好友列表功能');
        }

        // 显示收藏夹
        function showCollection() {
            alert('收藏夹功能');
        }

        // 分享资料
        function shareProfile() {
            if (navigator.share) {
                navigator.share({
                    title: '我的五子棋战绩',
                    text: '我在休闲五子棋中的胜率达到了68%！',
                    url: window.location.href
                });
            } else {
                alert('分享功能');
            }
        }
    </script>
</body>
</html>